package com.zyh.map;

import java.util.Enumeration;
import java.util.Hashtable;

/**
 * @Author zyh
 * @Date 2024/8/2 9:31
 * @Description Hashtable 类
 */

public class LinkedHashMapDemo2 {
    public static void main(String[] args) {
        Hashtable<Integer, String> map = new Hashtable<>();
        map.put(1,"a");
        map.put(3,"y");
        map.put(2,"r");
        map.put(5,"f");
        map.put(4,"s");
        Enumeration<Integer> keys = map.keys();
        while (keys.hasMoreElements()) {
            Integer key = keys.nextElement();
            String value = map.get(key);
            System.out.println(key+"--"+value);
        }
    }
}
